﻿<%@ Page Language="C#" AutoEventWireup="True" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<script runat="server"> 
    public void button_Click(Object s, EventArgs e) 
    { 
            
            if (chk.Checked == true) 
            {
               messageLabel.Text = "Hello World";      
            }
            else
            {
              messageLabel.Text = "Goodbye Cruel World";       
            }
    }

    protected void setInit(object sender, EventArgs e)
    {
        string c = TextBox1.Text.ToString();
        TextBox1.Text = ProperCase(c); 
    }
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<link rel="stylesheet" type="text/css" href="Styles/Site.css" />
<head>
<title runat="server" id="time">Build your Neighbor's website with ASP 4.0</title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"></script>

      <script type="text/javascript">
          var map = null;
          //var place = new VEPlace("570 W DEKALB PIKE, KING OF PRUSSIA, PA");
          //var LA = new VELatLong(34.0540, -118.2370);
          var LA = new VELatLong(40.089181, -75.380134);
          //Lat: 40.089181
          //Long: -75.380134
          //var LA = place.LatLong;

          function GetMap() {
              map = new VEMap('myMap');

              map.AttachEvent("oncredentialserror", MyHandleCredentialsError);
              map.AttachEvent("oncredentialsvalid", MyHandleCredentialsValid);
              map.SetCredentials("AtHMf2IvoVviTnwqe1lY-x-KcNSFTcz2EQYiZwYLTUZLqX6H8nezojBOEV0FguoK");
              map.HideDashboard();
              map.LoadMap(LA, 14, VEMapStyle.Road, false, VEMapMode.Mode2D, true, 1);
              pin02 = new VEShape(VEShapeType.Pushpin, LA);
              pin02.SetTitle("abhi's place");
              pin02.SetCustomIcon(
               "<span style='font-family:Arial; font-size:x-small;" +
               "color:black; background-color:White'>" +
               "<img src='images/pushpin.gif'/></span>");
              map.AddShape(pin02);
              map.SetMapStyle(VEMapStyle.Birdseye);
              map.SetZoomLevel(16);
          }


          function MyHandleCredentialsError() {
              alert("The credentials are invalid.");
          }

          function MyHandleCredentialsValid() {
              //alert("The credentials are valid.");

          }

      </script>
</head>
<body onload="GetMap();">
    <h2>
        Welcome to ASP.NET!
    </h2>
      <div id='myMap' style="position:relative; width:600px; height:400px;"></div>
    
    <form id="form1" runat="server">
    <div>
        <p>
        <asp:Button ID="button" runat="server"
            OnClick="button_Click"
                Text="Click Me" />
        <asp:Label ID="messageLabel" runat="server" />
            <asp:TextBox ID="TextBox1" runat="server" ontextchanged="setInit" 
                ToolTip="Insert Value" BorderWidth="1px"></asp:TextBox>
        <asp:CheckBox ID="chk" runat="server" Text="chk" />                 
        </p>
    </div>
    </form> 
    </body>
</html>